package com.yuexunit.operationman.nbsy.module.SafeOperation.adapter;

import android.widget.AbsListView;

import com.yuexunit.operationman.nbsy.module.SafeOperation.bean.SafeOperationBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Created by work-jx on 2017/3/1.
 */
public class BeforeNarcosisAdapter extends KJAdapter<SafeOperationBean.ObjectEntity.SecurityItemListEntity>{
    public ArrayList<SafeOperationBean.ObjectEntity.SecurityItemListEntity> lists = new ArrayList<SafeOperationBean.ObjectEntity.SecurityItemListEntity>();

    public BeforeNarcosisAdapter(AbsListView view, Collection<SafeOperationBean.ObjectEntity.SecurityItemListEntity> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
        lists = (ArrayList<SafeOperationBean.ObjectEntity.SecurityItemListEntity>) mDatas;
    }

    @Override
    public void convert(AdapterHolder adapterHolder, SafeOperationBean.ObjectEntity.SecurityItemListEntity item, boolean b, final int position) {
//        adapterHolder.setText(R.id.item_operation_observeform_name_tv,item.getName());
//        final RadioButton radioButton_select,radioButton_unselect;
//        radioButton_select = adapterHolder.getView(R.id.item_operation_observeform_radiobtn_01);
//        radioButton_unselect = adapterHolder.getView(R.id.item_operation_observeform_radiobtn_02);
//        RadioGroup radioGroup = adapterHolder.getView(R.id.item_operation_observeform_radiogroup);
//        radioGroup.setOnCheckedChangeListener(null);
//        if (lists.get(position).getStatus().equals("0"))
//        {
//            radioButton_unselect.setChecked(true);
//        }
//        else if(lists.get(position).getStatus().equals("1"))
//        {
//            radioButton_select.setChecked(true);
//        }
//
//
//        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
//            @Override
//            public void onCheckedChanged(RadioGroup group, int checkedId) {
//                if (checkedId == radioButton_select.getId()){
//                    lists.get(position).setStatus("1");
//                }
//                else  if (checkedId == radioButton_unselect.getId()){
//                    lists.get(position).setStatus("0");
//                }
//            }
//        });
    }

}
